<?php

namespace App\Models\Headquarters;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

/**
 * 采购入库单明细
 */
class PurInWarehsEntry extends Model
{
    use HasFactory;
    public $timestamps = FALSE;
    protected $table = 'T_IM_PurInWarehsEntry';
    protected $fillable = ['FID', 'CFScrwID', 'CFWzsqbh', 'CFPurdate', 'CFFylxmxID', 'CFFylxID', 'CFCanshu', 'CFCaizhi', 'FCostCenterOrgUnitID', 'FBizDate', 'FTaxPrice', 'FTaxAmount', 
                            'FReceiveStorageOrgUnitID', 'FIsFullWriteOff', 'FUnReturnedBaseQty', 'FUnWriteOffAmount', 'FUnWriteOffQty', 'FWrittenOffAmount', 'FWrittenOffQty', 'FQty', 'FAssistQty', 'FOutLocationID', 'FOutWarehouseID', 'FLocationID',
                            'FWarehouseID', 'FAssistUnitID', 'FAssCoefficient', 'FBaseUnitID', 'FSourceBillTypeID', 'FAssociateQty', 'FBaseStatus', 'FCoreBillTypeID', 'FPurOrderEntrySeq', 'FPurOrderNumber', 'FSourceBillEntrySeq', 'FSourceBillEntryID',
                            'FSourceBillNumber', 'FSourceBillID', 'FUnitID', 'FAssistPropertyID', 'FMaterialID', 'FSeq', 'FParentID'
                        ];

    public function __construct(array $attributes = [])
    {
        parent::__construct($attributes);
    }

    public function findRowById($Id){
        return self::whereRaw('FID COLLATE Latin1_General_BIN = ?', [$Id])->first();
    }
}
